package com.sky.mapper;

import com.sky.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.Map;

@Mapper
public interface UserMapper {


    @Select("select * from user  where openid = #{openId}")
    User selectUserByOpenId(String openId);



    void insertUser(User user);

    /**
     * 根据用户主键ID去查找用户。
     * @param userId
     * @return
     */
    @Select("select * from user where id = #{userId}")
    User selectByUserId(Long userId);


    /**
     * 用户数据统计
     * @param map
     * @return
     */
    Integer userStatistics(Map map);
}
